﻿using LKVService;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using System.Web.Mvc;

namespace LKVMLMADMIN.Controllers.Json
{
    public class JsonProfitController : Controller
    {
        public string ExecuteMonthly(int month,int year)
        {
            try
            {
                var profit = new ProfitService();
                profit.ExeCuteMonthCommission(month, year);
                return "1";
            }catch(Exception e)
            {
                return "0";
            }


        }
        public string ExecuteDaily(int day, int month, int year)
        {
            try
            {
                var profit = new ProfitService();
                profit.ExeCuteDaiyCommission(new DateTime(year,month ,day));
                return "1";
            }
            catch (Exception e)
            {
                return "0";
            }

        }
        public string ExecuteRemake(int day, int month, int year)
        {
            try
            {
                var profit = new ProfitService();
                profit.ExeCuteRemake(new DateTime(year, month, day));
                return "1";
            }
            catch (Exception e)
            {
                return "0";
            }

        }

    }
}
